package com.googlecode.likesql;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.SQLException;
import java.util.List;

/**
 * <p>The LikeSql class represents a SQL expression containing a SQL template and values.
 * A default conversion to a executable SQL is to implement {@link Object#toString()} to return a SQL string.
 * </p>
 * 
 * @author Johny Huang
 * @see    java.lang.Object#toString()
 */
public interface LikeSql {
	
	/**
	 * Returns the SQL template.
	 * @return SQL template.
	 */
	String toTemplate();
	
	/**
	 * Converts to a {@link java.sql.PreparedStatement PreparedStatement} instance.
	 * @param con {@link java.sql.Connection Connection}
	 * @return
	 */
	PreparedStatement toPreStatement(Connection con) throws SQLException;
	
	/**
	 * Returns a list containing all the values.
	 * 
	 * @return a list containing all the values.
	 */
	List getValueList();
}
